package org.jeecg.modules.demo.sjcjmb.service.impl;

import org.jeecg.modules.demo.sjcjmb.entity.YlshSjcjmb;
import org.jeecg.modules.demo.sjcjmb.entity.YlshSjcjmbsjx;
import org.jeecg.modules.demo.sjcjmb.mapper.YlshSjcjmbsjxMapper;
import org.jeecg.modules.demo.sjcjmb.mapper.YlshSjcjmbMapper;
import org.jeecg.modules.demo.sjcjmb.service.IYlshSjcjmbService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
import java.util.Map;

/**
 * @Description: ylsh_sjcjmb
 * @Author: jeecg-boot
 * @Date:   2021-12-13
 * @Version: V1.0
 */
@Service
public class YlshSjcjmbServiceImpl extends ServiceImpl<YlshSjcjmbMapper, YlshSjcjmb> implements IYlshSjcjmbService {

	@Autowired
	private YlshSjcjmbMapper ylshSjcjmbMapper;
	@Autowired
	private YlshSjcjmbsjxMapper ylshSjcjmbsjxMapper;
	
	@Override
	@Transactional
	public void delMain(String id) {
		ylshSjcjmbsjxMapper.deleteByMainId(id);
		ylshSjcjmbMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			ylshSjcjmbsjxMapper.deleteByMainId(id.toString());
			ylshSjcjmbMapper.deleteById(id);
		}
	}

	@Override
	public void createTable(String Name, String content) {
	    ylshSjcjmbMapper.createTable(Name,content);
	}

}
